﻿using Max.PH4_2104A.Shopping.Domain;
using Max.PH4_2104A.Shopping.DTO;

namespace Max.PH4_2104A.Shopping.IService
{
    /// <summary>
    /// 系统用户的服务接口
    /// </summary>
    public interface ISystemUserService
    {
        /// <summary>
        /// 添加数据
        /// </summary>
        /// <param name="model">系统用户的数据模型</param>
        /// <returns></returns>
        int Insert(SystemUserModel model);

        /// <summary>
        /// 修改数据
        /// </summary>
        /// <param name="model">系统用户的数据模型</param>
        int Update(SystemUserModel model);

        /// <summary>
        /// 删除数据
        /// </summary>
        /// <param name="model">系统用户的数据模型</param>
        int Delete(SystemUserModel model);

        /// <summary>
        /// 查询数据
        /// </summary>
        /// <returns>返回系统用户的所有数据</returns>
        IQueryable<SystemUserModel> GetAll();

        /// <summary>
        /// 查询分页数据
        /// </summary>
        /// <param name="pageIndex">页码（第几页）</param>
        /// <param name="pageSize">页大小（每页显示几条）</param>
        /// <param name="total">记录总条数</param>
        /// <returns>符合条件的记录集</returns>
        IQueryable<SystemUserModel> GetAll(int pageIndex,int pageSize,out int total);

        /// <summary>
        /// 根据名称模糊查询并分页
        /// </summary>
        /// <param name="name">查询名称</param>
        /// <param name="pageIndex">页码（第几页）</param>
        /// <param name="pageSize">页大小（每页显示几条）</param>
        /// <param name="total">记录总条数</param>
        /// <returns>符合条件的记录集</returns>
        IQueryable<SystemUserModel> GetAll(string? name,int pageIndex, int pageSize, out int total);

        /// <summary>
        /// 根据ID获取一条数据
        /// </summary>
        /// <param name="id">主键id</param>
        /// <returns>符合条件的记录集</returns>
        SystemUserModel GetFirstById(object id);

        /// <summary>
        /// 用户登录
        /// </summary>
        /// <param name="userName">用户名</param>
        /// <param name="password">密码</param>
        /// <returns>登录成功以否、登录的提示信息、登录的用户信息</returns>
        Tuple<ResponseStateCode, SystemUserOutputDto> Login(string userName, string password);

    }
}